home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 3.0 KB | 97 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1992 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Originator: Kent Sandvik
- Date: Wednesday, June 10, 1992 22:37:24
- Revision comments are at the end of this file.
- ---
- TProcess is a Process Manager class.
- Process.h contains the header file information for the TProcess class construction.
- _________________________________________________________________________________________________________ */
-
- // Declare label for this header file
- #ifndef _PROCESS_
- #define _PROCESS_
-
-
- #ifndef _DTSCPLUSLIBRARY_
- #include "DTSCPlusLibrary.h"
- #endif
-
- // Toolbox Include Files
-
- #ifndef __PROCESSES__
- #include <Processes.h>
- #endif
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
-
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
-
- // GLOBAL TYPEDEFS AND ENUMS
- const ProcessSerialNumber kMyProcess = {
- kNoProcess, kNoProcess};
-
-
- // _________________________________________________________________________________________________________ //
- // Class Interface
-
- class TProcess
- // The TProcess class provides information from the Process Manager.
- {
- public:
- // CONSTRUCTORS & DESTRUCTORS
- TProcess(ProcessSerialNumber = kMyProcess); // default constructors
- virtual~ TProcess(); // virtual destructor
-
- // MAIN INTERFACE
- virtual Boolean KillApplication(ProcessSerialNumber*);// quit the application
- virtual short GetNumProcesses(); // get the N amount of currently running procs
- virtual ProcessInfoRec GetProcessInfoRec(); // fetch the whole process info rec
- virtual unsigned long GetProcessSize(); // get the size of the process
- virtual unsigned long GetFreeMem(); // get free memory available for the process
- virtual unsigned long GetLaunchDate(); // get in seconds the launch time
- virtual Boolean FindProcess(OSType signature);// find process with the right signature
-
- // PUBLIC ACCESSORS AND MUTATORS
- virtual ProcessSerialNumber GetMyProcessID() const;
- virtual ProcessSerialNumber GetProcessID() const;
-
- // ITERATORS
- virtual void Next(); // next PSN
- virtual Boolean Last(); // last PSN?
- virtual void First(); // reset to first PSN
-
- // INITIATION ROUTINES
- protected:
- virtual Boolean IProcess(); // initialize needed class information
-
- // FIELDS
- private:
- ProcessSerialNumber fProcessID; // any specific PSN number
- ProcessSerialNumber fMyProcessID; // our PSN number
- ProcessSerialNumber fFirstPSN; // the first one we got
- Boolean fFirstTime; // signals order of iterators
- Boolean fLast; // used to signal last process in an iterator list
- Boolean fState; // state of the object
- OSErr fError; // latest toolbox error
- };
-
-
- #endif
-
- // _________________________________________________________________________________________________________ //
-
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 6/10/92 New file
- 2 khs 7/6/92 First decent working class
- */
-
-
-